package permissions

import (
	"context"
	"goAdminV1/api/permissions/v1"
	"goAdminV1/internal/model"
	"goAdminV1/utility"
)

func (c *ControllerV1) PermissionDelete(ctx context.Context, req *v1.PermissionDeleteReq) (res *v1.PermissionDeleteRes, err error) {
	err = model.PermissionsDelete(ctx, req.Id)
	if err != nil {
		return nil, utility.Error(utility.CodeOperation, err)
	}
	return &v1.PermissionDeleteRes{
		Message: "权限删除成功",
	}, nil
}
